import { Moment } from 'moment';

export const REG_TIME_MOMENT = /\d{1,2}:\d{1,2}(:\d{1,2})?/;
export const REG_DATE_MOMENT = /\d{4}[-/]\d{1,2}[-/]\d{1,2}?/;

export function setMomentToSameDay(targetMoment: Moment, referenceMoment: Moment) {
    targetMoment.year(referenceMoment.year());
    targetMoment.month(referenceMoment.month());
    targetMoment.date(referenceMoment.date());
    return targetMoment;
}